package cn._2dland.comment
{
	import cn._2dland.utils.IDataCompareRule;
	
	import com.yahoo.astra.utils.DateUtil;

	/**
	 * 弹幕顺序比较规则
	 * @author deadblue
	 */	
	public class CommentCompareRule implements IDataCompareRule
	{
		public function CommentCompareRule() {}

		public function getMinimum():Object {
			return {playTime:Number.MIN_VALUE};
		}

		public function getMaximum():Object {
			return {playTime:Number.MAX_VALUE};
		}

		public function compare(obj1:Object, obj2:Object, level:int):int {
			var comp:int = obj1.playTime - obj2.playTime;
			if(level > 1) {
				if(comp == 0)
					comp = obj1.sendTime - obj2.sendTime;
			}
			return comp;
		}
	}
}